<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录聚美优美</title>
    <link rel="stylesheet" href="css/common.css" />
    <link rel="stylesheet" href="css/other.css" />
    <script src="js/axios.min.js"></script>
</head>
<body>
    <!-- 头部 -->
    <div id="login_header">
        <div class="login_log">
            <a href="" class="login_link"></a>
        </div>
        <div class=" login_img">
            <a href="" class="login_link1"></a>
            <a href="" class="login_link2"></a>
            <a href="" class="login_link3"></a>
        </div>
    </div>

    <!--内容 -->

    <div id="login_contain_wrap">
        <div class="login_contain_img"></div>
        <div class="login_contain_box">
            <div class="login_contain_title">
                <h1><strong>登录聚美</strong></h1>
                <div class="login_contain_title_one">
                    还没有聚美账号？
                    <a href="">30秒注册</a>
                </div>
            </div>

            <div class="login_contain_two">
                <span>
                    <input name="method" type="radio" rel="login-dynamic-form" value="dynamic" id="radio_dynamic">
                    <label for="radio_dynamic">
                        手机动态密码登录
                    </label>
                </span>
                <span>
                    <input name="method" type="radio" rel="login-user-form" value="normal" id="radio_normal">
                    <label for="radio_normal">
                        普通登录
                    </label>
                </span>
            </div>
            <form action="" id="login_contain_form">
                <div class="login_contain_user">
                    <input type="text" placeholder="已注册的手机号码" id="dynamic_mobile" autofocus="" autocomplete="off"
                        value="">
                    <div class="focus_text">请输入11位手机号码</div>
                </div>
                <div class="login_contain_passward">
                    <div class="login_contain_pass_left">
                        <input type="text" placeholder="动态密码" id="dynamic_password" autocomplete="off">
                    </div>
                    <div class="login_contain_pass_right">
                        <a href="javascript:;" id="getPhoneCode" class="phonecode">
                            <strong>获取手机动态密码</strong></a>
                    </div>
                </div>

                <p><label for=""><label for="dynamic_auto_login">
                            <input type="checkbox" id="dynamic_auto_login" checked="">
                            &nbsp;自动登录
                        </label></p>

                <input  type="button" value="登 录" style=" display: block;width: 100%;">

            </form>
        </div>

        <!-- -------footer---- -->
        <div class="footer">
            <p>
                Copyright&copy;2010-2015 北京创锐文化传媒有限公司 Jumei.com 保留一切权利。客服热线：400-123-8888
            </p>
            <p>
                京公网安备 11010102001226 号 | 京ICP证111033号 | 食品流通许可证 SP1101051110165515（1-1） | 营业执照
            </p>
            <ul class="footer-link">
                <li>
                    <a></a>
                </li>
                <li>
                    <a href="#" class="f-link2"></a>
                </li>
                <li>
                    <a class="f-link3"></a>
                </li>
                <li>
                    <a class="f-link4"></a>
                </li>
                <li>
                    <a href="#" class="f-link5"></a>
                </li>
            </ul>
        </div>


    </div>

    <script>
           
        let ipts = document.querySelectorAll('input');
        ipts[5].onclick = function () {
            let username = ipts[2].value
            let password = ipts[3].value

            let regAPI = 'http://jx.xuzhixiang.top/ap/api/login.php'

            axios.get(regAPI, {
                params: {
                    username,
                    password
                }
            }).then(function (res) {
                // 请求成
                console.log(res);
                console.log(res.data);//真正的数据

           alert(res.data.msg)

                if (res.data.code == 1) {
                    location.href = 'index.html'
                    localStorage.setItem("uid",res.data.data.id)
                    localStorage.setItem("token",res.data.data.token)

                    // uid	    45158	
                    // token	c2f347346098e535573f15e08ac8ffb1
                }
            }).catch(function (err) {
                
                console.log(err);
            })


        }

    </script>














</body>

</html>